import request from '@/utils/request'

export const getRoleList = (params) => { // 项目内人员列表
  return request.post('/system/role/listByProjectId', { ...params })
}
export const getRoleDesc = (params) => { // 查看项目内的人员详情
  return request.get('/system/role/userInfo', { params })
}
export const getDepartList = () => { // 查看项目内的部门列表
  return request.get('/system/role/getAllDept')
}
export const getAllRoleList = () => { // 查看项目内的角色列表
  return request.get('/system/role/getAllSysRole')
}
export const addRole = (params) => { // 项目内新增用户
  return request.post('/system/role/addUser', { ...params })
}

export const deleteRole = (params) => { // 项目内删除用户(多选、单选)
  return request.post('/system/role/deleteUser', { ...params.userIdsDTO }, { params: { projectId: params.projectId } })
}

export const editRole = (params) => { // 项目内编辑用户
  return request.post('/system/role/updateUser', { ...params.sysUserDTO }, { params: { userId: params.userId } })
}

export const disableRole = (params) => { // 项目内禁用用户
  return request.post('/system/role/updateUsers', { ...params.userIdsDTO }, { params: { status: params.status } })
}
